<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var a, b
    (function () {
        console.log(a); //? 局部a undefined
        console.log(b); //? 全局b undefined
        var a = (b = 3);//? 仍存在提升 故函数中的第一个loga中的a是这里的a
        console.log(a); //? 局部a 3
        console.log(b); //? 全局b 3
    })()
    console.log(a); //? 全局a undefined
    console.log(b); //? 3
</script>
</body>
</html>
